package com.atguigu.gmall.mq.receiver;

import com.atguigu.gmall.mq.config.DeadLetterConfig;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: 封捷
 * @create-date: 2022/9/11 10:44
 */
@Configuration
public class DeadLetterReceiver {

    @RabbitListener(queues = DeadLetterConfig.QUEUE_DEAD_NAME)
    public void process(String message) {
        System.out.println("[Receive Message]" + message + " " + new SimpleDateFormat("HH:mm:ss").format(new Date()));
    }

}
